var express = require("express");
var app = express();

app.get("/AAb",function(req,res){   // 路由地址不区分大小写 还有?后面的东西都会被忽略
    res.send("你好");
});

app.get("/student/:id",function(req,res){
    var id = req.params["id"];
    var reg = /^[\d]{6}$/;
    if(reg.test(id)){
        res.send(id);        
    }else{
        res.send("请检查格式");
    }
})

app.get("/:username/:oid",function(req,res){
    var username = req.params["username"];
    var oid = req.params["oid"];

    res.write(username);
    res.end(oid);
});

app.listen(3000);